<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>
        
        <p:dialog id="EventCreateDlg" widgetVar="EventCreateDialog" modal="true" resizable="false" appendTo="@(body)" header="#{message.CreateEventTitle}">
                      
            <h:form id="EventCreateForm">
                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{eventController.selected != null}">
                        
                        <p:outputLabel value="Event Name:" for="eventName" />
                        <p:inputText id="eventName" value="#{eventController.selected.eventName}" title="#{message.CreateEventTitle_eventName}" />
                        
                        <p:outputLabel value="Private" for="eventPrivacy" />
                        <p:selectBooleanCheckbox id="eventPrivacy" value="#{eventController.selected.eventPrivacy}" />
                        
                        <p:outputLabel value="Starting Time:" for="eventStartingTime" />
                        <p:calendar id="eventStartingTime" pattern="MM/dd/yyyy HH:mm:ss" value="#{eventController.selected.eventStartingTime}" title="#{message.EditEventTitle_eventStartingTime}"  showOn="button"/>
                        
                        <p:outputLabel value="Ending Time:" for="eventEndingTime" />
                        <p:calendar id="eventEndingTime" pattern="MM/dd/yyyy HH:mm:ss" value="#{eventController.selected.eventEndingTime}" title="#{message.EditEventTitle_eventEndingTime}"  showOn="button"/>
                        
                        <p:outputLabel value="Type:" for="eventType" />
                        <p:selectOneRadio id="eventType" value="#{eventController.selected.eventType}">
                            <f:selectItem itemLabel="Indoor" itemValue="indoor"></f:selectItem>
                            <f:selectItem itemLabel="Outdoor" itemValue="outdoor"></f:selectItem>
                        </p:selectOneRadio>
                        
                    <p:panelGrid columns="2">

                            <p:outputLabel value="City Name:" for="city" />
                            <p:inputText id="city" value="#{eventController.selected.eventLocation.city}" title="#{message.CreateAddressTitle_city}" />
             
                    </p:panelGrid>
                    
               
                    </p:panelGrid>
                    <p:commandButton actionListener="#{eventController.create}" value="#{message.Save}" update="display,:EventListForm:datalist,:growl" oncomplete="handleSubmit(args,'EventCreateDialog');"/>
                    <p:commandButton value="#{message.Cancel}" onclick="EventCreateDialog.hide()"/>
                </h:panelGroup>
            </h:form>
            
            
            
        </p:dialog>

    </ui:composition>
</html>
